package com.ycz.sas.jgen.domain;

import java.io.File;
import java.nio.channels.FileLock;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class CacheInfo {
	
	private String comparePath;
	private String customPath;
	private String targetPath;
	private String jarPath;
	private String sourcePath;
	private String configPath;
	private String ignoreFolders;
	
	private List<String> paths;
	
	private List<File> diffFiles;
	
	private Map<String, FileLock> fileLocks;
	
	public CacheInfo(){
		paths = new ArrayList<String>();
		diffFiles = new ArrayList<File>();
		fileLocks = new HashMap<String, FileLock>();
	}
	
	public Map<String, FileLock> getFileLocks() {
		return fileLocks;
	}

	public void setFileLocks(Map<String, FileLock> fileLocks) {
		this.fileLocks = fileLocks;
	}

	public String getIgnoreFolders() {
		return ignoreFolders;
	}

	public void setIgnoreFolders(String ignoreFolders) {
		this.ignoreFolders = ignoreFolders;
	}

	public List<File> getDiffFiles() {
		return diffFiles;
	}

	public void setDiffFiles(List<File> diffFiles) {
		this.diffFiles = diffFiles;
	}

	public String getComparePath() {
		return comparePath;
	}

	public void setComparePath(String comparePath) {
		this.comparePath = comparePath;
	}

	public String getCustomPath() {
		return customPath;
	}

	public void setCustomPath(String customPath) {
		this.customPath = customPath;
	}

	public String getTargetPath() {
		return targetPath;
	}

	public void setTargetPath(String targetPath) {
		this.targetPath = targetPath;
	}

	public String getJarPath() {
		return jarPath;
	}

	public void setJarPath(String jarPath) {
		this.jarPath = jarPath;
	}

	public String getConfigPath() {
		return configPath;
	}

	public void setConfigPath(String configPath) {
		this.configPath = configPath;
	}

	public List<String> getPaths() {
		return paths;
	}

	public void setPaths(List<String> paths) {
		this.paths = paths;
	}
	
	public String getSourcePath() {
		return sourcePath;
	}

	public void setSourcePath(String sourcePath) {
		this.sourcePath = sourcePath;
	}

	public int bytesize(){
		int i = 0;
		i += comparePath.length() + 10;
		i += customPath.length() + 12;
		i += targetPath.length() + 12;
		i += jarPath.length() + 9;
		i += sourcePath.length() + 12;
		i += ignoreFolders.length() + 15;
		int len = paths.size();
		for (int j = 0; j < len; j++) {
			i += paths.get(j).length() + 1;
		}
		return i;
	}

}
